var xs = [
    [-2075, -1638, -721, -273, 308, 7064, 8827],
    [7876, 7322, 6144, 2610, -322, -2359],
    [-2182, -1352, -609, 3225, 6181, 7069],
    [-1376, -2547, -5789, -6987, -13309, -13954, -14577]
];

function act() {
    cm.getReactor().forceHitReactor(cm.getPlayer(), 1);
    cm.enableActions();
    var level = Math.floor((cm.getMapId() - 867142200) / 100);
    if (level >= 4) {
        level = 7 - level
    }
    var x = cm.getPlayer().getPosition().x;
    for (var i = 0; i < xs[level].length; i++) {
        if (Math.abs(x - xs[level][i]) < 200) {
            var reactor = "action" + level + "_" + i;
            eval(reactor)();
            cm.enableActions();
            break
        }
    }
}

function action0_0() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b1c_01"], [0], [2], [-1928], [-174]);
    cm.dynamicObjMove(-1928, -174, -1928, -1000, -1928, -174, 1, 0, -1, "door_s_b1c_01")
}

function action0_1() {
    cm.getMap().onSyncDynamicFoothold(["elev_s_b1c_00"], [0], [2], [-1488], [510]);
    cm.dynamicObjMove(-1488, 510, -1488, -24, -1488, 510, 1, 0, -6, "elev_s_b1c_00")
}

function action0_2() {
    cm.getMap().onSyncDynamicFoothold(["elev_s_b1c_02"], [0], [2], [-589], [510]);
    cm.dynamicObjMove(-589, 510, -589, -24, -589, 510, 1, 0, -6, "elev_s_b1c_02")
}

function action0_3() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b1c_02"], [0], [2], [-162], [-174]);
    cm.dynamicObjMove(-162, -174, -162, -712, -162, -174, 1, 0, -1, "door_s_b1c_02")
}

function action0_4() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b1c_03"], [0], [2], [423], [-174]);
    cm.dynamicObjMove(423, -174, 423, -712, 423, -174, 1, 0, -1, "door_s_b1c_03")
}

function action0_5() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b1c_04"], [0], [2], [7175], [-174]);
    cm.dynamicObjMove(7175, -174, 7175, -1400, 7175, -174, 1, 0, -1, "door_s_b1c_04")
}

function action0_6() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b1c_05"], [0], [2], [8945], [-174]);
    cm.dynamicObjMove(8945, -174, 8945, -1000, 8945, -174, 1, 0, -1, "door_s_b1c_05")
}

function action1_0() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_00"], [0], [2], [7754], [-174]);
    cm.dynamicObjMove(7754, -174, 7754, -1000, 7754, -174, 1, 0, -1, "door_s_b2c_00")
}

function action1_1() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_01"], [0], [2], [7185], [-174]);
    cm.dynamicObjMove(7185, -174, 7185, -1000, 7185, -174, 1, 0, -1, "door_s_b2c_01")
}

function action1_2() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_02"], [0], [2], [6006], [-174]);
    cm.dynamicObjMove(6006, -174, 6006, -1000, 6006, -174, 1, 0, -1, "door_s_b2c_02")
}

function action1_3() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_05"], [0], [2], [2462], [-174]);
    cm.dynamicObjMove(2462, -174, 2462, -712, 2462, -174, 1, 0, -1, "door_s_b2c_05")
}

function action1_4() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_06"], [0], [2], [-459], [-174]);
    cm.dynamicObjMove(-459, -174, -459, -1000, -459, -174, 1, 0, -1, "door_s_b2c_06")
}

function action1_5() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b2c_07"], [0], [2], [-2525], [-174]);
    cm.dynamicObjMove(-2525, -174, -2525, -712, -2525, -174, 1, 0, -1, "door_s_b2c_07")
}

function action2_0() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b3c_01"], [0], [2], [-1929], [-174]);
    cm.dynamicObjMove(-1929, -174, -1929, -1000, -1929, -174, 1, 0, -1, "door_s_b3c_01")
}

function action2_1() {
    cm.updateInfoQuest(63485, "rf=b3c_02;bt0=1;vt=vent_s_b3c_00;b3=eld");
    cm.getMap().onSyncDynamicFoothold(["elev_s_b3c_00"], [0], [2], [-1036], [-539]);
    cm.dynamicObjMove(-1036, -539, -1036, -36, -1036, -539, 1, 0, 13, "elev_s_b3c_00")
}

function action2_2() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b3c_02"], [0], [2], [-460], [-174]);
    cm.dynamicObjMove(-460, -174, -460, -712, -460, -174, 1, 0, -1, "door_s_b3c_02")
}

function action2_3() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b3c_04"], [0], [2], [3359], [-174]);
    cm.dynamicObjMove(3359, -174, 3359, -712, 3359, -174, 1, 0, -1, "door_s_b3c_04")
}

function action2_4() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b3c_06"], [0], [2], [6304], [-174]);
    cm.dynamicObjMove(6304, -174, 6304, -712, 6304, -174, 1, 0, -1, "door_s_b3c_06")
}

function action2_5() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b3c_07"], [0], [2], [7208], [-174]);
    cm.dynamicObjMove(7208, -174, 7208, -712, 7208, -174, 1, 0, -1, "door_s_b3c_07")
}

function action3_0() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_01"], [0], [2], [-1497], [-146]);
    cm.dynamicObjMove(-1497, -146, -1497, -656, -1497, -146, 1, 0, -1, "door_s_b4c_01")
}

function action3_1() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_02"], [0], [2], [-2664], [-146]);
    cm.dynamicObjMove(-2664, -146, -2664, -656, -2664, -146, 1, 0, -1, "door_s_b4c_02")
}

function action3_2() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_07"], [0], [2], [-5904], [-28]);
    cm.dynamicObjMove(-5904, -28, -5904, -537, -5904, -28, 1, 0, -1, "door_s_b4c_07")
}

function action3_3() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_08"], [0], [2], [-7088], [-28]);
    cm.dynamicObjMove(-7088, -28, -7088, -537, -7088, -28, 1, 0, -1, "door_s_b4c_08")
}

function action3_4() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_03"], [0], [2], [-13438], [-146]);
    cm.dynamicObjMove(-13438, -146, -13438, -656, -13438, -146, 1, 0, -1, "door_s_b4c_03")
}

function action3_5() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_04"], [0], [2], [-14075], [-144]);
    cm.dynamicObjMove(-14075, -144, -14075, -656, -14075, -144, 1, 0, -1, "door_s_b4c_04")
}

function action3_6() {
    cm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/blackHeaven/door_open", 100);
    cm.getMap().onSyncDynamicFoothold(["door_s_b4c_05"], [0], [2], [-14714], [-147]);
    cm.dynamicObjMove(-14714, -147, -14714, -656, -14714, -147, 1, 0, -1, "door_s_b4c_05")
}
var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, d, c) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            var f = cm.getReactor().getId();
            var a = cm.getReactor().getName();
            cm.sendOk("这个传送点 [" + f + " : " + a + "] 的脚本尚未修复。\r\n脚本位于： 脚本/反应堆/9999000.js ", 0)
        } else {
            cm.dispose()
        }
    }
};